import {Toast} from 'antd-mobile';
import OrderListService from '../services/orderListService';

/**
 * Created by 小敏哥 on 2017/10/10.
 */

export const getInspectionOrderList=(data, callBack)=> {
    return (dispatch, getState) => {
        Toast.hide();
        Toast.loading("", 30, () => Toast.info("网络错误", 2));
        OrderListService.getInspectionOrderList(data).then((result)=>{
            Toast.hide();
            if (result.code == 1000) {
                callBack(result.data.inspectionOrderList);
            }
            else {
                Toast.info(result.msg, 2);
            }
        });
    }
};